package br.com.kapa.beans;

import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import br.com.kapa.dao.DaoUsuarioBean;
import br.com.kapa.utils.Hash;

/**
 * Session Bean implementation class UsuarioBean
 */
@Stateless(mappedName="bean/usuario")
@WebService
public class UsuarioBean implements UsuarioBeanRemote {

	@WebMethod(operationName="VerificaUsuario")
	public boolean veirificaUsuario(@WebParam(partName="email")String email, @WebParam(partName="senha")String senha) {
		DaoUsuarioBean dao = new DaoUsuarioBean();
		if (dao.findUsuario(email, Hash.md5(senha)) != null)
			return true;
		else
			return false;
		
	}
	
	@WebMethod(operationName="ToMd5")
	public String toMd5(@WebParam(partName="str")String str) {
		return Hash.md5(str);	
	}
}
